<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <script src="vue.js"></script>
    <script>
      var Com = Vue.extend({
        props: ['msg'],
        template: `
              <div>
                  <p>{{firstName}} {{lastName}} aka {{alias}}</p>
                  <h1>{{msg}}</h1>
                </div>
            `,
        data: function() {
          return {
            firstName: 'Walter',
            lastName: 'White',
            alias: 'Heisenberg'
          }
        }
      })
      // propsData 创建实例时传递 props  ：只用于 new 创建的实例中
      var mycom = new Com({
        propsData: {
          msg: '你好'
        }
      })
      // 全局的api函数 $mount() 渲染  $destory() $watch $data $el
      mycom.$mount('#app')
    </script>
  </body>
</html>
